<div class="bjui-pageContent">

    <!--添加按钮-->
    <button type="button" class="btn-default" data-toggle="dialog" data-options="{
            id:'edit-order-report-type-dialog',
            url:'/admin/order/eidtOrderReportType',
            width:800,
            height:500,
            title:'添加'
        }">
        添加
    </button>
    <table class="table table-bordered" id="order-report-type-list-filter" data-toggle="datagrid" data-options="{
            height: '95%',
            showToolbar: false,
            toolbarItem: 'add,edit,del,|,import,export,exportf',
            dataUrl: '/admin/order/getOrderReportTypeListData?callback=?',
            delUrl: '/admin/order/delOrderReportType',
            delPK: 'id',
            dataType: 'jsonp',
            jsonPrefix: 'obj',
            paging: {pageSize:60},
            showCheckboxcol: true,
            linenumberAll: false,
            fieldSortable: false,
            filterThead: false,
            columnMenu: false,
        }">
        <thead>
        <tr>
            <th data-options="{name:'id',width:200}">订单报表类型id</th>
            <th data-options="{name:'title',width:200}">订单报表类型名称</th>
            <th data-options="{align:'center',width:300,render:chooseContent}">设置报表内容</th>
            <th data-options="{align:'center',width:300,render:chooseSendUser}">设置发送用户</th>
            <th data-options="{align:'center',width:300,render:editOrderReportType}">操作</th>

        </tr>
        </thead>
    </table>
</div>
<script>
    var curOrderId = '';

    function editOrderReportType(value, data) {
        var html = '<button type="button" class="btn btn-green" data-toggle="dialog" data-options="{id:\'edit-order-report-type-dialog\',fresh:true, url:\'/admin/order/eidtOrderReportType\', title:\'编辑\',width:800,height:500, data:{order_report_type_id:' + data.id + '}}"><i class="fa fa-edit"></i> 编辑</button>';
        html += '<button type="button" class="btn-red" data-toggle="del.datagrid.tr">删除</button>';
        return html
    }

    function getCurOrderId(orderId){
        curOrderId = orderId;
    }

    function chooseContent(value, data){
        var html = '<button type="button" class="btn btn-green" data-toggle="dialog" data-options="{id:\'choose-order-report-cell\',fresh:true, url:\'/admin/order/chooseOrderReportCell\', title:\'设置报表内容\',width:800,height:600, data:{order_report_type_id:' + data.id + '}}"><i class="fa fa-edit"></i> 设置报表内容</button>';
        return html;
    }

    function chooseSendUser(value, data){
        var html = '<button type="button" class="btn btn-green" data-toggle="dialog" data-options="{id:\'choose-sendUser\',fresh:true, url:\'/admin/order/chooseSendUser\', title:\'设置发送用户\',width:800,height:600, data:{order_report_type_id:' + data.id + '}}"><i class="fa fa-edit"></i> 设置发送用户</button>';
        return html;
    }


</script>